/**
 * 身份验证路由
 * 处理用户注册、登录和身份验证相关路由
 */

const express = require('express');
const { register, login, getMe, logout } = require('../controllers/auth');
const { protect } = require('../middleware/auth');

const router = express.Router();

// 注册和登录路由
router.post('/register', register);
router.post('/login', login);

// 需要身份验证的路由
router.get('/me', protect, getMe);
router.get('/logout', protect, logout);

module.exports = router; 